<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
    
        let a = [
            {name:"年初的",age:18},
            {name:"凯哥",age:25},
            {name:"娘炮晨",age:26},
            {name:"科比",age:40},
            {name:"安东尼",age:36}
        ];

        a.sort(function(a, b) {
            return a.age - b.age;
        })
        console.log(a);

    </script>
</body>
</html>